<?php
/**
* @package   auto_occasion
* @subpackage guideAchat
* @author    your name
* @copyright 2011 your name
* @link      http://www.yourwebsite.undefined
* @license    All rights reserved
*/

class FoGuideAchatCtrl extends jController {
    
    /**
    * Page guideachat : front
    */
    function index() {
        jClasses::inc('marqueModele~marqueSrv');
        jClasses::inc('publicite~pubSrv');
        jClasses::inc('commun~parametre');
        jClasses::inc('essais~essaisSrv');
        jClasses::inc('commun~parametre');
        jClasses::inc('guideAchat~guideAchatSrv') ;
        
        $type = $this->intParam('id', 0);
        $headerContent = guideAchatSrv::readXml($type);
        
        $rep = $this->getResponse('htmlFo');  
        $rep->menusActifs = frontHtmlResponse::MENU_GUIDE_ACHAT;
        $rep->breadCrumb  = array(frontHtmlResponse::MENU_ACCUEIL, frontHtmlResponse::MENU_GUIDE_ACHAT) ;

        // change le header de la page en cours
        $rep->title					=	isset($headerContent->title)?$headerContent->title:'' ;
		$headerContent->keywords	=	isset($headerContent->keywords)?$headerContent->keywords:'' ;
		$headerContent->desc		=	isset($headerContent->desc)?$headerContent->desc:'' ;
		$keywords					= "<meta name='keywords' content='" . $headerContent->keywords . "'>" ;
		$description				= "<meta name='Description' content='" . $headerContent->desc. "'>" ;
        $rep->addHeadContent($keywords);
        $rep->addHeadContent($description);

        // ---

        $rep->addCSSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/css/sliderkit.css');

        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/jquery.sliderkit.1.9.1.pack.js');
        $rep->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/front/js/pub.js');

        $tpl = 'guideAchat~FoGuideAchat';
        
        if($type) {
            $tpl  .= $type;
            
            $title = guideAchatSrv::getPageName($type);
            $rep->body->assign("title", $title['fil']);
        }
        
        $rep->bodyTpl = $tpl;
        
         //pubHidden et rightContent
        $paramPub = array('p1'=>PUB_RIGHT_1_ID,'p2'=>PUB_RIGHT_2_ID,'p3'=>PUB_RIGHT_3_ID,'p4'=>PUB_RIGHT_4_ID,'p5'=>PUB_RIGHT_5_ID,'p6'=>PUB_RIGHT_6_ID);
        $rep->body->assignZone('oZonePubHidden', 'commun~FoPubHidden',$paramPub);
        
        $paramRight = array('ad'=>1,'no_need_cc2'=>1);
        $rep->body->assignZone('oZoneRightContent', 'commun~FoRightContent', $paramRight);
        //---
    
   
        return $rep;
    }
    
}

